<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对象的简写</title>
</head>
<body>
<p>
    对象中的属性名和需要赋值的变量名一致时， 可以省略属性名
    Let user2 ={name,age}；
</p>

<script>
    let  name = "张三";
    let age = 12;

    //对象用户对象的传统方式  属性:值
    let  user = {name:name,age:age};
    console.log(user);

    //对象简写      属性
    let user2 = {name, age};
    console.log(user2);
</script>
</body>
</html>